<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<div class="layout">
	<span v-show="isShow" v-text="txt"></span>
<input type="button" value="显示隐藏切换" v-on:click="toggle">
</div>
	<script src="vue1026.js"></script>
	<script>
		var vm = new Vue({
			el:'.layout',
			data:{
				txt:'使用v-show切换元素的显示与隐藏的原理是给当前元素添加或移除display:none属性来控制',
				isShow:true,
			},
			methods:{
				toggle:function(){
					this.isShow=!this.isShow;
				}
			},
		});
	</script>
</body>
</html>
